﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<WebSite.Models.BaseModel>" %>
<%@ Import Namespace="WebSite.Models" %>
<%@ Import Namespace="WebSite.App_Code" %>
<%@ Import Namespace="WebSite.App_Data" %>

<script type="text/javascript">

    function PageTo() { $("#Page_Index").val($("#Page_Index_Sel").val()); }
    function PageSet() { $("#Page_Size").val($("#Page_Size_Txt").val()); }
    
</script>

<%=Html.HiddenFor(o => o.Page_Index, new { id = "Page_Index" }) %>
<%=Html.HiddenFor(o => o.Page_Size, new { id = "Page_Size" }) %>


<table border="0" cellpadding="0" cellspacing="0">
    <tr>
        <% if (Model.Row_Count > 0) { %>
        <td style=" padding:0px 5px 0px 0px">总数:<%=Model.Row_Count %></td>
        <td style=" padding:0px 5px 0px 5px">当前页:<%=Model.Page_Index + 1 %></td>
        <td style=" padding:0px 5px 0px 5px">
            <select id="Page_Index_Sel">
                <% for (int i = 0; i <= ((Model.Row_Count - 1) / Model.Page_Size); i++) { %>
                <option value="<%=i %>" <%if(i==Model.Page_Index){ %> selected="selected" <%} %>><%=i+1 %></option>
                <% } %>
            </select>
        </td>
        <td style=" padding:0px 5px 0px 5px">            
            <div class="budget-button-no-01">
                <input type="submit" class="budget-submit-no-01" hidefocus="true" value="跳转" onclick="PageTo()" />
            </div>
        </td>
        <td style=" padding:0px 5px 0px 5px">
            每页显示行
        </td>
        <td>
            <input id="Page_Size_Txt" value="<%=Model.Page_Size %>" class="budget-txt-no-01" style=" width:20px" />
        </td>
        <td style=" padding:0px 5px 0px 5px">
            <div class="budget-button-no-01">
                <input type="submit" class="budget-submit-no-01" hidefocus="true" value="设置" onclick="PageSet()" />
            </div>
        </td>
        <% } %>
    </tr>
</table>